Fixed code for improving