modularised with many functions, made main function that called all functions -- this makes order clearer. \\ also made options dynamic to fit categories