created working functions