- end of base implementation. working solution