completed implementation of bind