working code as of 3/22