adding working implementation