Debugged code.
Resolve merge conflict, replace megan's changes