had to split script into two files :(