completed first attempt at evaluation function