cleaned up parts b and d some