added alignment
fixed bugs