refactored Lines.js quite a bit