Began programming main functionality