with functions implemented