fixed a few conflicts and made sure code compiles file (see diff for more details)