#1: cleaned up code