cleaned up code. added vector struct