Wrote basic functionality