A simple approach to heterojunctions