Start optimising and error-handling