Fixed logical errors and added Context and ContextualController