Filling Jars problem