added functionality, needs testing