added init function to modes