Implemented knot class, moved appropriate functions onto class as methods