changed linear to length and added more definitions