Better code but still not working