adding support for text labels; making gravity optional