Finished all implementation except output formatting