better code and example usage