first solution attempted