changed to swing and added initial support for listening