Updated

Mostly finished, checks input, all functions working without error.