working solution, before style check