Incomplete solution - runs into time limit