evaluate method refractored
finished and ready to submit