Added all functionalities for archives and main