Modified conditions. Removed unused method.