complete homework for advanced functions