Changed forms, cleaned up code