less complicated use of previously written functions