fixed bug and added print statement for debugging...