Modified code for smaller angles; added commenting