added the miter limit and cleaned up the code a bit
added the basic line with part, but it's just not working so I need
to replace it later

also cleaned up some of the code