Added boundaries and partially coded gravity+acceleration