Added drop checks
Cleaned up code