major changes to multiple functions