first solution attempt