new syntax

created some functions and better readable code