Cleaning up model, Added tangent calculation, NOT TESTED.