added correct (I believe) functions for the programming task