efficiency changes to #4