Changes

Optimized the code a bit