got rid of some unnecessary calculations