Finished reworking some problems in python