Added initialization and slope functions