completed code

all functions work individually, still need to optimise the code.
Hardware is good.