Added flags. Not 100% done yet.