finally got things functioning