fixed a few logic sections, cleaned script up