refactored solution to #193
using case statements instead of if/else
added some methods for routine tasks (adding files, getting relative paths, etc..)
using regular expressions to match ownership rules