resolving conflict + update based on discussion about issue #52

lines 174-181 may require changes