big update: complete main & sub logic; basic style