Merged beeri's old changes