working solution
syntactic cleanup