Updated temporary storage dir and added minor changes to code