added logic functionality